﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraEditors;
using DevExpress.XtraTreeList;
using System.Xml;
using System.Collections;
using DevExpress.XtraTreeList.Columns;
using System.Xml.XPath;
using efuture.xml;
using DevExpress.Utils.Drawing;
using efuture.http;
using System.IO;

namespace efuture.vdrp
{

    public partial class frmMain : XtraForm
    {

        public frmMain()
        {
            InitializeComponent();

        }

        private void comboBoxEdit1_EditValueChanged(object sender, EventArgs e)
        {
            defaultLookAndFeel1.LookAndFeel.SkinName = comboBoxEdit1.Text;
        }

        private void simpleButton3_Click(object sender, EventArgs e)
        {
            //
            XMLHelper.BindingData(panelControl1, new StringReader(Application.StartupPath + "/sale.get.xml"), "/Root/SaleOrder");


        }

        private void treeList2_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {

        }

        private void treeList2_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            //
        }

        private void panelControl3_Paint(object sender, PaintEventArgs e)
        {

        }

        private void frmMain_Shown(object sender, EventArgs e)
        {
            //
        }

        private void treeList2_CustomDrawNodeIndicator(object sender, CustomDrawNodeIndicatorEventArgs e)
        {
            TreeList tmpTree = sender as DevExpress.XtraTreeList.TreeList; 
            IndicatorObjectInfoArgs args = e.ObjectArgs as IndicatorObjectInfoArgs; 
            if (args != null) { 
                int rowNum = tmpTree.GetVisibleIndexByNode(e.Node) + 1; 
                //宽度跟随行数字大小改变 
                tmpTree.IndicatorWidth = rowNum.ToString().Length * 10 + 10; 
                //绘制行号 
                args.DisplayText = rowNum.ToString(); 
            }
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            MessageBox.Show(XMLHelper.encode(panelControl1, "SaleOrder"));
        }

    }


}